package cn.tedu;

import java.util.LinkedList;

public class Test3 {
    public static void main(String[] args) {
        LinkedList l=new LinkedList();
        l.add(99);
        l.add('中');
        l.add("中");
        l.add(true);
        l.add(1,888);
        System.out.println(l);

        LinkedList l2=new LinkedList();
        l2.add(1);
        l2.add(2);
        l2.add(3);
        l2.add(99);
        l2.add(true);

        System.out.println(l.size());
        System.out.println(l.addAll(l2));
        System.out.println(l);
        System.out.println(l.containsAll(l2));
        //System.out.println(l);
       // System.out.println(l.removeAll(l2));
        //System.out.println(l);
        System.out.println(l.retainAll(l2));
        System.out.println(l);

        l.addFirst("100");
        l.addLast("200");//没有返回值
        System.out.println(l);
        System.out.println(l.getFirst());
        System.out.println(l.getLast());
        System.out.println(l.removeFirst());
        System.out.println(l.removeLast());
        System.out.println(l);
    }
}
